# Maintainer: George Rawlinson <grawlinson@archlinux.org>

pkgname=python-sphinx-prompt
pkgver=1.5.0
pkgrel=2
pkgdesc='Sphinx directive to add unselectable prompt'
arch=('any')
url='https://github.com/sbrunner/sphinx-prompt'
license=('BSD')
depends=(
  'python'
  'python-sphinx'
  'python-pygments'
  'python-docutils'
)
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-wheel'
  'python-setuptools'
)
_commit='427351db81469d8065b4632ae201c9d26e1f8062'
source=("$pkgname::git+$url#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd "$pkgname"

  git describe --tags | sed 's/^v//'
}

build() {
  cd "$pkgname"

  python -m build --wheel --no-isolation
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
